second patch Arjan van de Ven <arjan@fenrus.demon.nl> to autodetect/load
authorJonathan Blandford <jrb@redhat.com>
Fri, 5 Nov 1999 21:29:33 +0000 (21:29 +0000)
committerJonathan Blandford <jrb@src.gnome.org>
Fri, 5 Nov 1999 21:29:33 +0000 (21:29 +0000)
1999-11-05  Jonathan Blandford  <jrb@redhat.com>

* src/gdk-pixbuf-io.c: second patch Arjan van de Ven
<arjan@fenrus.demon.nl> to autodetect/load the sunras files.

gdk-pixbuf/gdk-pixbuf-io.c

index 9ce4fa79fed971950678490a5fe79bbdfb830b0c..33aeb99483032211c13c95ea4282f12885429e21 100644 (file)
@@ -120,6 +120,21 @@ pixbuf_check_pnm (guchar *buffer, int size)
        }
        return FALSE;
 }
+static gboolean
+pixbuf_check_sunras (guchar *buffer, int size)
+{
+       if (size < 32)
+               return FALSE;
+
+       if (buffer [0] != 0x59 ||
+           buffer [1] != 0xA6 ||
+           buffer [2] != 0x6A ||
+           buffer [3] != 0x95)
+               return FALSE;
+
+       return TRUE;
+}
+
 
 #if 0
 static gboolean
@@ -144,6 +159,7 @@ GdkPixbufModule file_formats [] = {
 #define XPM_FILE_FORMAT_INDEX 4
        { "xpm",  pixbuf_check_xpm, NULL,  NULL, NULL, NULL, NULL, NULL },
        { "pnm",  pixbuf_check_pnm, NULL,  NULL, NULL, NULL, NULL, NULL },
+       { "ras",  pixbuf_check_sunras, NULL,  NULL, NULL, NULL, NULL, NULL },
 #if 0
        { "bmp",  pixbuf_check_bmp, NULL,  NULL, NULL, NULL, NULL, NULL },
 #endif